package edu.umn.msse.farside.FourH.web;

import edu.umn.msse.farside.FourH.services.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

/**
 * User: Farside
 * Date: Mar 17, 2009
 * To change this template use File | Settings | File Templates.
 */
@Controller
@RequestMapping("/futureEvents")
public class FutureEventsController
{
    private EventService eventService;

    @Autowired
    public void setEventService(EventService eventService) {
        this.eventService = eventService;
    }

    @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST})
    public String listFutureEvents(HttpServletRequest request) {
        request.setAttribute("futureEvents", eventService.listActiveEvents());
        return "futureEvents";
    }
}
